package com.baizhi.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class DemoController {
    private static final Logger logger = LoggerFactory.getLogger(DemoController.class);

    @RequestMapping("demo")
    public String demo() {
        logger.debug("demo ok!!!");
        return "demo";
    }

    // 等价于上面的写法
    @RequestMapping("demo1")
    public ModelAndView demo1() {
        logger.debug("demo ok!!!");
        return new ModelAndView("demo");
    }
}
